package logic

import (
	"context"

	"demo003/internal/svc"
	"demo003/internal/types"

	"github.com/zeromicro/go-zero/core/logx"
)

type GetUserLogic struct {
	logx.Logger
	ctx    context.Context
	svcCtx *svc.ServiceContext
}

func NewGetUserLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetUserLogic {
	return &GetUserLogic{
		Logger: logx.WithContext(ctx),
		ctx:    ctx,
		svcCtx: svcCtx,
	}
}

func (l *GetUserLogic) GetUser(req *types.GetUserReq) (resp *types.GetUserResp, err error) {
	// 模拟获取用户数据
	user := types.User{
		Id:   req.Id,
		Name: "张三",
		Age:  25,
	}

	resp = &types.GetUserResp{
		User: user,
	}

	return
}
